#include <stdio.h>

int main()
{
    int n, t;
    long long m;
    long long table[91];
    table[1] = 1;
    table[2] = 1;
    for (int i = 3; i <= 90; i++)
    {
        table[i] = table[i - 1] + table[i - 2];
    }
    scanf("%d", &t);
    for (int i = 0; i < t; i++)
    {
        scanf("%d%lld", &n, &m);
        while (n > 2)
        {
            if (m <= table[n - 1])
            {
                n--;
            }
            else
            {
                m -= table[n - 1];
                n -= 2;
            }
        }
        if (n == 1)
            printf("a\n");
        else
            printf("b\n");
    }
}